
Instructions for replication of analysis presented in
In Song Kim. "Political Cleavages within Industry: Firm-level Lobbying for
Trade Liberalization" American Political Science Review (2017),
Vol. 111, No. 1, pp. 1-20.


######################################################################
*** I. Install Dependencies *** 
######################################################################
Please begin by installing the following R package to reproduce all
the outputs.

- countrycode: version = 1.1.0
- vcd = 1.4-4
- png = 0.1-7
- arm = 1.10-1
- lme4 = 1.1-19
- mvtnorm = 1.0-8

######################################################################
*** II. R codes for the Analysis ***
######################################################################

- fig1.R reproduces Figure 1: Within-Industry Variance in Applied
  Tariff Rates

- fig2.R reproduces Figure 2: Inconsistencies Between Heckscher-Ohlin
  Model and Actual Trade Flows

- fig3.R reproduces Figure 3: Inconsistencies Between the
Ricardo-Viner Model and Actual Trade Flows

- fig6.R contains the code used to produce Figure 6. The original
  analysis is done via parallel computing for cross-validation without
  setting the seed, and so this code won't produce the exact same
  figure with different number of nodes and platform. However, the
  substantive finding that bills related to certain products being
  more likely to be lobbied holds.

- fig8.R reproduces Figure 8: Topic of Trade Bills Likely to be Lobbied

- fig9.R reproduces Figure 9: Lower Tariffs on Differentiated Products



######################################################################
*** III. Datasets ***
######################################################################

The following files are data files used for the analysis.

- mfn_us_89_11.csv: this data contains the US MFN Ad valorem tariff
rates. Ad valorem equivalents of non–ad valorem tariffs are calculated
based on UNCTAD Method 1 as noted in footnote 1. This data is from
WITS (World Integrated Trade Solution) available at
https://wits.worldbank.org/


- HML.zip: unzipping this file will return 6 files in the following
  format: YEAR_[exp/imp]HML.csv. This data contains hs6 digit-level US
  import/export data for years 1991, 2000, 2009 in which either the
  source or destination market is low, medium, or high income
  country. These files are used to produce Figure 2 in the main text.

- sic87_intra.csv: this data contains the US imports/exports data at
SIC4 level. The trade data between 1972 and 2005 are from
Peter Schott's "International Economics Resource Page: Trade Data and
Concordances" available at
http://faculty.som.yale.edu/peterschott/sub_international.htm This
data is used to produce Figure 3 in the main text.

- tradebills.txt (need to unzip tradebills.txt.zip first): this file
 contains bill text for trade bills including the miscellaneous tariff
 bills

- trade_bills_summary.txt: this file contains summary text of trade
  bills

- trade_bills_reports.txt: this file contains data for lobbied trade
  bills and their associated lobbying report IDs

- hs8_sigma_ntb_BG.csv (need to unzip hs8_sigma_ntb_BG.csv.zip first)
  : this file contains trade and industry-level data.  ntb measure is
  from Bown (2012) TTBD data. NAICS industry level data is from
  Marvakov, Becker, and Gray (2000) originally available from
  http://www.nber.org/nberces/. The measure of product differentiation
  is from Broda and Weinstein available at
  http://www.columbia.edu/~dew35/TradeElasticities/TradeElasticities.html
  
